﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QDT.Web.GenerageRodomKey
{
    public class RandomKey
    {
        private char[] randomRangeTable =   
        {   
            '0','1','2','3','4','5','6','7','8','9'   
        };
        public string GenerateRandomNumber(int Length)
        {
            System.Text.StringBuilder newRandom = new System.Text.StringBuilder(randomRangeTable.Length);
            Random rd = new Random();
            for (int i = 0; i < Length; i++)
            {
                newRandom.Append(randomRangeTable[rd.Next(randomRangeTable.Length)]);
            }
            return newRandom.ToString();
        }
    }
}